package com.cloudkinto.service.qianyi.vo;

import com.cloudkinto.common.error.ErrorEnum;
import lombok.Data;

@Data
public class QianyiPageResponse<T> extends QianyiResponse<T> {
    private boolean isLastPage;
    private int currentPage;
    private int pageCount;

    /**
     * 成功
     *
     * @param data
     * @return
     */
    public static <T> QianyiPageResponse<T> success(boolean isLastPage, int currentPage, int pageCount, T data) {
        QianyiPageResponse result = new QianyiPageResponse();
        result.setIsLastPage(isLastPage);
        result.setCurrentPage(currentPage);
        result.setPageCount(pageCount);
        result.setSuccess("true");
        result.setMessage(ErrorEnum.SUCCESS.getResultMsg());
        result.setData(data);
        return result;
    }

    public boolean getIsLastPage() {
        return isLastPage;
    }

    public void setIsLastPage(boolean lastPage) {
        isLastPage = lastPage;
    }

}
